package com.lims.landInfo.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javacommon.base.*;

import cn.org.rapid_framework.util.*;
/**
 * @author zzh
 * @version 1.0
 * @since 1.0
 */
@Entity
@Table(name = "LIMS_Project")
public class Project extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 5454155825314635342L;
	// date formats
	public static final String FORMAT_LAND_DATE = DATE_FORMAT;
	public static final String FORMAT_CREATE_DATE = DATE_FORMAT;

	// 可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	// columns START
	/**
	 * objid db_column: OBJID
	 */
	private java.lang.String objid;
	/**
	 * sno db_column: sno
	 */
	private java.lang.Integer sno;
	/**
	 * landno db_column: landno
	 */
	private java.lang.String landno;
	/**
	 * position db_column: position
	 */
	private java.lang.String position;
	/**
	 * projectType db_column: projectType
	 */
	private java.lang.Integer projectType;
	/**
	 * finistArea db_column: finistArea
	 */
	private java.lang.Double finistArea;
	/**
	 * annualArea db_column: annualArea
	 */
	private java.lang.Double annualArea;
	/**
	 * finistNum db_column: finistNum
	 */
	private java.lang.Integer finistNum;
	/**
	 * buildingArea db_column: buildingArea
	 */
	private java.lang.Double buildingArea;
	/**
	 * totalNum db_column: totalNum
	 */
	private java.lang.Integer totalNum;
	/**
	 * newBuildArea db_column: newBuildArea
	 */
	private java.lang.Double newBuildArea;
	/**
	 * newNum db_column: newNum
	 */
	private java.lang.Integer newNum;
	/**
	 * planArea db_column: planArea
	 */
	private java.lang.Double planArea;
	/**
	 * planNum db_column: planNum
	 */
	private java.lang.Integer planNum;
	/**
	 * rateProgress db_column: rateProgress
	 */
	private java.lang.String rateProgress;
	/**
	 * describe db_column: describe
	 */
	private java.lang.String describe;
	/**
	 * landDate db_column: landDate
	 */
	private java.util.Date landDate;
	/**
	 * createDate db_column: createDate
	 */
	private java.util.Date createDate;
	// columns END

	public Project() {
	}

	public Project(java.lang.String objid) {
		this.objid = objid;
	}

	public void setObjid(java.lang.String value) {
		this.objid = value;
	}

	@Id
	@GeneratedValue(generator = "custom-id")
	@GenericGenerator(name = "custom-id", strategy = "uuid")//unique = true, 
	@Column(name = "OBJID", nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getObjid() {
		return this.objid;
	}

	@Column(name = "sno", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getSno() {
		return this.sno;
	}

	public void setSno(java.lang.Integer value) {
		this.sno = value;
	}

	@Column(name = "landno", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public java.lang.String getLandno() {
		return this.landno;
	}

	public void setLandno(java.lang.String value) {
		this.landno = value;
	}

	@Column(name = "position", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getPosition() {
		return this.position;
	}

	public void setPosition(java.lang.String value) {
		this.position = value;
	}

	@Column(name = "projectType", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getProjectType() {
		return this.projectType;
	}

	public void setProjectType(java.lang.Integer value) {
		this.projectType = value;
	}

	@Column(name = "finistArea", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getFinistArea() {
		return this.finistArea;
	}

	public void setFinistArea(java.lang.Double value) {
		this.finistArea = value;
	}

	@Column(name = "annualArea", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getAnnualArea() {
		return this.annualArea;
	}

	public void setAnnualArea(java.lang.Double value) {
		this.annualArea = value;
	}

	@Column(name = "finistNum", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getFinistNum() {
		return this.finistNum;
	}

	public void setFinistNum(java.lang.Integer value) {
		this.finistNum = value;
	}

	@Column(name = "buildingArea", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getBuildingArea() {
		return this.buildingArea;
	}

	public void setBuildingArea(java.lang.Double value) {
		this.buildingArea = value;
	}

	@Column(name = "totalNum", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTotalNum() {
		return this.totalNum;
	}

	public void setTotalNum(java.lang.Integer value) {
		this.totalNum = value;
	}

	@Column(name = "newBuildArea", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getNewBuildArea() {
		return this.newBuildArea;
	}

	public void setNewBuildArea(java.lang.Double value) {
		this.newBuildArea = value;
	}

	@Column(name = "newNum", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getNewNum() {
		return this.newNum;
	}

	public void setNewNum(java.lang.Integer value) {
		this.newNum = value;
	}

	@Column(name = "planArea", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public java.lang.Double getPlanArea() {
		return this.planArea;
	}

	public void setPlanArea(java.lang.Double value) {
		this.planArea = value;
	}

	@Column(name = "planNum", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getPlanNum() {
		return this.planNum;
	}

	public void setPlanNum(java.lang.Integer value) {
		this.planNum = value;
	}

	@Column(name = "rateProgress", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getRateProgress() {
		return this.rateProgress;
	}

	public void setRateProgress(java.lang.String value) {
		this.rateProgress = value;
	}

	@Column(name = "describe", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getDescribe() {
		return this.describe;
	}

	public void setDescribe(java.lang.String value) {
		this.describe = value;
	}

	@Transient
	public String getLandDateString() {
		return DateConvertUtils.format(getLandDate(), FORMAT_LAND_DATE);
	}

	public void setLandDateString(String value) {
		setLandDate(DateConvertUtils.parse(value, FORMAT_LAND_DATE,
				java.util.Date.class));
	}

	@Column(name = "landDate", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public java.util.Date getLandDate() {
		return this.landDate;
	}

	public void setLandDate(java.util.Date value) {
		this.landDate = value;
	}

	@Transient
	public String getCreateDateString() {
		return DateConvertUtils.format(getCreateDate(), FORMAT_CREATE_DATE);
	}

	public void setCreateDateString(String value) {
		setCreateDate(DateConvertUtils.parse(value, FORMAT_CREATE_DATE,
				java.util.Date.class));
	}

	@Column(name = "createDate", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public java.util.Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(java.util.Date value) {
		this.createDate = value;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.append("Objid", getObjid()).append("Sno", getSno())
				.append("Landno", getLandno())
				.append("Position", getPosition())
				.append("ProjectType", getProjectType())
				.append("FinistArea", getFinistArea())
				.append("AnnualArea", getAnnualArea())
				.append("FinistNum", getFinistNum())
				.append("BuildingArea", getBuildingArea())
				.append("TotalNum", getTotalNum())
				.append("NewBuildArea", getNewBuildArea())
				.append("NewNum", getNewNum())
				.append("PlanArea", getPlanArea())
				.append("PlanNum", getPlanNum())
				.append("RateProgress", getRateProgress())
				.append("Describe", getDescribe())
				.append("LandDate", getLandDate())
				.append("CreateDate", getCreateDate()).toString();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(getObjid()).toHashCode();
	}

	public boolean equals(Object obj) {
		if (obj instanceof Project == false)
			return false;
		if (this == obj)
			return true;
		Project other = (Project) obj;
		return new EqualsBuilder().append(getObjid(), other.getObjid())
				.isEquals();
	}
}
